<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div#hello{
            background-color: lightblue;
        }
        @keyframes slide-in {
            from{
                transform: translateX(100%);
            }
            to{
                transform: translateX(0);
            }
        }
        @keyframes slide-out {
            from{
                transform: translateX(0);
            }
            to{
                transform: translateX(-100%);
            }
        }
        .slide-enter-active, .slide-leave-active{
            animation-duration: 3s;
        }
        .slide-enter-active{
            animation-name: slide-in;
        }
        .slide-leave-active{
            animation-name: slide-out;
        }

    </style>
</head>
<body>
    <div id="app">
      <button @click="show = !show">toggle</button>
      <transition name="slide">
        <div id="hello" v-if="show">hello</div>
      </transition>
    </div>
    <script src="vue.js"></script>
    <script>
        var vm = new Vue({
            el:'#app',
            data:{
                show:true
            }
        });
    </script>
</body>
</html>